<include file="Public:header" />
<div class="headbar">
	<div class="position"><span>商户</span><span>></span><span>文章管理</span><span>></span><span>分类管理</span></div>
	<div class="operating">
		<a href="{:U('Article/article_cat_edit')}"><button class="operating_btn" type="button"><span class="addition">添加分类</span></button></a>
	</div>
</div>
<div class="content">
	<table id="list_table" class="list_table">
		<colgroup>
			<col width="550px" />
			<col width="70px" />
			<col />
		</colgroup>

		<thead>
			<tr>
				<th>分类名称</th>
				<th>系统</th>
				<th>操作</th>
			</tr>
		</thead>

		<tbody>
                        <foreach name='article_category' item='item'>
			<tr id="{$item.id}" parent="{$item.parent_id}">
				<td><img style="margin-left:{$item.path}px" class="operator" src="__PUBLIC__/Operation/images/admin/close.gif" onclick="displayData(this);" alt="关闭" />{$item['name']}</td>
				<td><if condition="$item['issys'] eq 1">是<else/>否</if></td>
				<td>
                                    <a href="{:U('Article/article_cat_edit', array('id' => $item[id]))}"><img class="operator" src="__PUBLIC__/Operation/images/admin/icon_edit.gif" alt="编辑" title="编辑" /></a>
					<a href='javascript:void(0)' onclick="delModel({link:{:U('Article/cat_del',array(id=>$item[id]))})"><img class="operator" src="__PUBLIC__/Operation/images/admin/icon_del.gif" alt="删除" title="删除" /></a>
				</td>
			</tr>
                        </foreach>
		</tbody>
	</table>
</div>
<script language="javascript">
//折叠展示
function displayData(_self)
{
	if(_self.alt == "关闭")
	{
		jqshow($(_self).parent().parent().attr('id'), 'hide');
		$(_self).attr("src", "__PUBLIC__/Operation/images/admin/open.gif");
		_self.alt = '打开';
	}
	else
	{
		jqshow($(_self).parent().parent().attr('id'), 'show');
		$(_self).attr("src", "__PUBLIC__/Operation/images/admin/close.gif");
		_self.alt = '关闭';
	}
}

function jqshow(id,isshow)
{
	var obj = $("#list_table tr[parent='"+id+"']");
	if(obj.length > 0)
	{
		obj.each(function(i){
			jqshow($(this).attr('id'),isshow);
		});

		if(isshow == 'hide')
		{
			obj.hide();
		}
		else
		{
			obj.show();
		}
	}
}
</script>
<include file="Public:footer" />